import type {
  StartPage,
  LoginPage,
  CropImg,
  SearchPage,
  Webview,
  FileResourceSetting,
  SelectFriends,
  SelectTags,
  SelectCircles,
  InviteFriends,
  AddFriend,
  FriendApplyDetail,
  CardDetail,
  FriendSetting,
  TagMembers,
  FriendSharedFiles,
  CircleDetail,
  CardBasicInfo,
  CardContactInfo,
  CardCompanyInfo,
  CardProductService,
  CardAttachmentDocs,
  CircleSetting,
  EditCircleInfo,
  CircleFileUploadLimit,
  SelectMembers,
  CompanyDetail,
  ProductDetail,
  TransferSuperAdmin,
  CircleAdminManagement,
  CircleMemberSetting,
  SelectMemberIdentity,
  AddCircleSharedFile,
  AiChatPage,
  CircleFileSetting,
  CircleApplyDetail,
  AssistantInvite,
  RealNameAuth,
  AttachmentDocsChoose,
} from './modules';

export type NavOptions = {
  startPage: StartPage;
  login: LoginPage;
  cropImg: CropImg;
  searchPage: SearchPage;
  webview: Webview;
  fileResourceSetting: FileResourceSetting;
  selectFriends: SelectFriends;
  selectTags: SelectTags;
  selectCircles: SelectCircles;
  inviteFriends: InviteFriends;
  addFriend: AddFriend;
  friendApplyDetail: FriendApplyDetail;
  cardDetail: CardDetail;
  friendSetting: FriendSetting;
  tagMembers: TagMembers;
  friendSharedFiles: FriendSharedFiles;
  circleDetail: CircleDetail;
  cardBasicInfo: CardBasicInfo;
  cardContactInfo: CardContactInfo;
  cardCompanyInfo: CardCompanyInfo;
  cardProductService: CardProductService;
  cardAttachmentDocs: CardAttachmentDocs;
  circleSetting: CircleSetting;
  editCircleInfo: EditCircleInfo;
  circleFileUploadLimit: CircleFileUploadLimit;
  selectMembers: SelectMembers;
  companyDetail: CompanyDetail;
  productDetail: ProductDetail;
  transferSuperAdmin: TransferSuperAdmin;
  circleAdminManagement: CircleAdminManagement;
  circleMemberSetting: CircleMemberSetting;
  selectMemberIdentity: SelectMemberIdentity;
  addCircleSharedFile: AddCircleSharedFile;
  aiChatPage: AiChatPage;
  circleFileSetting: CircleFileSetting;
  circleApplyDetail: CircleApplyDetail;
  assistantInvite: AssistantInvite;
  realNameAuth: RealNameAuth;
  attachmentDocsChoose: AttachmentDocsChoose;
};

export type OnloadOptions<T> = T extends keyof NavOptions ? NavOptions[T] : Recordable;

type NavigateToOptions<T> = {
  name: T;
  animationType?: UniApp.NavigateToOptions['animationType'];
  animationDuration?: UniApp.NavigateToOptions['animationDuration'];
};
export type CustomNavigateToOptions<T> = T extends keyof NavOptions
  ? NavigateToOptions<T> & { options: OnloadOptions<T> }
  : NavigateToOptions<T> & { options?: Recordable };